package com.miracle.controller;

import com.miracle.common.response.HttpResult;
import com.miracle.common.response.ResultCodeEnum;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/httpRest")

/*
 * 测试Controller
 * @author jie.xi
 * @date 2022/4/21 14:08
 */
public class HttpRestController {


    @GetMapping("/success")
    public HttpResult success(){
        return HttpResult.success();
    }


    @GetMapping("/successWithData")
    public HttpResult successWithData(){return HttpResult.success("MiracleTest");}

    @GetMapping("/failure")
    public HttpResult failure(){
        return HttpResult.failure(ResultCodeEnum.NOT_FOUND);
    }

}
